﻿using WH.Model.Bases;
using WH.Common.Bases.IBase;
using SqlSugar;

namespace WH.Model.Systems
{
    /// <summary>
    /// 操作记录
    ///</summary>
    [SugarTable("sys_operation_log")]
    public class SysOperationLogEntity : BaseOrgAuditableEntity, IOrganizationFilter
    {
        /// <summary>
        /// 目标ip 
        ///</summary>
        [SugarColumn(ColumnName = "ip_address", IsNullable = true, Length = 50, ColumnDescription = "目标ip")]
        public string? IpAddress { get; set; }
        /// <summary>
        /// 请求方法 
        ///</summary>
        [SugarColumn(ColumnName = "method", IsNullable = true, Length = 50, ColumnDescription = "请求方法")]
        public string? Method { get; set; }
        /// <summary>
        /// 描述 
        ///</summary>
        [SugarColumn(ColumnName = "describe", IsNullable = true, Length = 255, ColumnDescription = "描述")]
        public string? Describe { get; set; }
        /// <summary>
        /// 操作类型 
        ///</summary>
        [SugarColumn(ColumnName = "operate_type", IsNullable = true, Length = 50, ColumnDescription = "操作类型")]
        public string? OperateType { get; set; }
        /// <summary>
        /// 操作者id 
        ///</summary>
        [SugarColumn(ColumnName = "operator_id", IsNullable = true, Length = 50, ColumnDescription = "操作者id")]
        public string? OperatorId { get; set; }
        /// <summary>
        /// 是否成功 
        ///</summary>
        [SugarColumn(ColumnName = "is_success", IsNullable = true, Length = 1, ColumnDescription = "是否成功")]
        public bool? IsSuccess { get; set; }

        /// <summary>
        /// 是否成功 
        ///</summary>
        [SugarColumn(ColumnName = "status_code", IsNullable = true, Length = 10, ColumnDescription = "是否成功")]
        public int? StatusCode { get; set; }

        /// <summary>
        /// 请求参数 
        ///</summary>
        [SugarColumn(ColumnName = "request_object", IsNullable = true, ColumnDataType = "text", ColumnDescription = "请求参数")]
        public string? RequestObject { get; set; }
        /// <summary>
        /// 返回参数 
        ///</summary>
        [SugarColumn(ColumnName = "response_object", IsNullable = true, ColumnDataType = "text", ColumnDescription = "返回参数")]
        public string? ResponseObject { get; set; }
        /// <summary>
        /// 请求路径 
        ///</summary>
        [SugarColumn(ColumnName = "request_url", IsNullable = true, Length = 500, ColumnDescription = "请求路径")]
        public string? RequestUrl { get; set; }
        /// <summary>
        /// 目标平台 
        ///</summary>
        [SugarColumn(ColumnName = "platform", IsNullable = true, Length = 50, ColumnDescription = "目标平台")]
        public string? Platform { get; set; }

        /// <summary>
        /// 响应时间 
        ///</summary>
        [SugarColumn(ColumnName = "stopwatch", IsNullable = true, Length = 64, ColumnDescription = "响应时间")]
        public long? Stopwatch { get; set; }

        /// <summary>
        /// 用户名称 
        ///</summary>
        [SugarColumn(ColumnName = "user_account", IsNullable = true, Length = 50, ColumnDescription = "用户名称")]
        public string? UserAccount { get; set; }


        /// <summary>
        /// 机构id
        /// </summary>           
        [SugarColumn(ColumnName = "organization_id", IsNullable = false, Length = 50, ColumnDescription = "机构id")]
        public override string OrganizationId { get; set; } = null!;
    }
}
